
#include<iostream>
using namespace std;
int main()
{
    int N = 0;
    cin >> N;
    int geshu = 0;

    for (int i = 1;i <= N;i++) {
        int cout = 0;
        int n = i;
        int x = 1;
        while (n / 10 != 0) {
            if ((n % 10) % 2 != 0 && x % 2 != 0) {
                cout++;
            }
            n = n / 10;
            x++;
        }
        if (n % 2 != 0 && x%2!=0) {
            cout++;
        }
        else if (x % 2 == 0 && n % 2 == 0) {
            cout++;
        }
        if (cout == x) {
            geshu++;
        }

    }
    cout << geshu << endl;
    return 0;
}